<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id='app'>
        <button @click='num++'>点击增加</button>
        {{num}}
    </div>
</body>
<script src="./vue.js"></script>
<script>
    const vm=new Vue({
        el:'#app',
        data:{
            num:2
        },
        watch:{
            num(newvl,oldvl){
                console.log('哈哈，我来监听你了')
                console.log(oldvl)
                console.log(newvl)
            }
        }
        
        

    })
</script>
</html>